package com.example.yuejian.yuejian.bean;

import com.google.gson.Gson;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by Administrator on 2017/9/28.
 */

public class Order {


    /**
     * id : 3
     * users_id : 2
     * train_id : 1
     * pay_type : 支付宝
     * num : 0
     * phone : 212547854685658555
     * state : 0
     * money : 615.0
     * createtime : 2017-10-05 15:47:24
     * userphoto : 2017-09-01-07-05-26-59a906b68b5b5.jpg
     * username : 戴仁k
     * trainname : 1
     * trainphoto : 2017-09-04-05-49-33-59ace96d1784c.jpg
     */

    private int id;
    private int users_id;
    private int train_id;
    private String pay_type;
    private int num;
    private String phone;
    private int state;
    private String money;
    private String createtime;
    private String userphoto;
    private String username;
    private String trainname;
    private String trainphoto;

    public static Order objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), Order.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setUsers_id(int users_id) {
        this.users_id = users_id;
    }

    public void setTrain_id(int train_id) {
        this.train_id = train_id;
    }

    public void setPay_type(String pay_type) {
        this.pay_type = pay_type;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public void setState(int state) {
        this.state = state;
    }

    public void setMoney(String money) {
        this.money = money;
    }

    public void setCreatetime(String createtime) {
        this.createtime = createtime;
    }

    public void setUserphoto(String userphoto) {
        this.userphoto = userphoto;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public void setTrainname(String trainname) {
        this.trainname = trainname;
    }

    public void setTrainphoto(String trainphoto) {
        this.trainphoto = trainphoto;
    }

    public int getId() {
        return id;
    }

    public int getUsers_id() {
        return users_id;
    }

    public int getTrain_id() {
        return train_id;
    }

    public String getPay_type() {
        return pay_type;
    }

    public int getNum() {
        return num;
    }

    public String getPhone() {
        return phone;
    }

    public int getState() {
        return state;
    }

    public String getMoney() {
        return money;
    }

    public String getCreatetime() {
        return createtime;
    }

    public String getUserphoto() {
        return userphoto;
    }

    public String getUsername() {
        return username;
    }

    public String getTrainname() {
        return trainname;
    }

    public String getTrainphoto() {
        return trainphoto;
    }
}
